<template>
	<view class="box" @tap="onclick1" :style="{background: color}">{{num}}</view>
	<switch checked="true" @change="onChange" />
</template>

<script setup>
import { ref } from 'vue';
	let num = ref(0)
	let color = ref("#000000")
	function onclick1(){
		num.value++
		color.value = "#" + String(Math.random()).substring(3,9)
		console.log("123123")
	}
	
	function onChange(e) {
		if (e.detail.value) {
			num.value = 100
		} else {
			num.value = 60
		}
	}
</script>

<style>
</style>